function request() {
  return new Promise((resolve, reject) => {
    resolve("1");
  });
}

let queue = [];

request()
  .then((resp) => {
    // 请求拦截器
    console.log("then1", resp); // then1 1

    return new Promise((resolve) => {
      queue.push(() => {
        resolve();
      });
    });
  })
  .then((resp) => {
    // 真正发请求
    console.log("then2", resp); // then2 undefined
  });

setTimeout(() => {
  queue.forEach((cb) => {
    cb();
  });
}, 10000);

// then1 1
// 等待10s
// then2 undefined
